package com.myopen.kit;

import java.util.UUID;

public class UUIDKit {

	/**
	 * 获得一个UUID
	 * 
	 * @return String UUID
	 */
	public static String getUUID() {
		return UUID.randomUUID().toString().replaceAll("-", "");
	}

	/**
	 * 获得指定数目的UUID
	 * 
	 * @param number
	 *            int 需要获得的UUID数量
	 * @return String[] UUID数组
	 */
	public static String getUUID(int number) {
		if (number < 1) {
			return null;
		}

		StringBuffer str = new StringBuffer();
		int a = number % 32 + 1;
		for (int i = 0; i < a; i++) {
			str.append(getUUID());
		}

		return str.substring(0, number);
	}


}
